<?php if(!defined('WANYA_ROOT')) {exit('error!');}?>
<div class=containertitle><b>课程管理-签到信息一览</b>
<?php if(isset($_GET['active_del'])):?><span class="actived">删除用户成功</span><?php endif;?>
<?php if(isset($_GET['active_update'])):?><span class="actived">编辑用户资料成功</span><?php endif;?>
</div>
<div class=line></div>

<form action="attendance_list.php" method="post" name="form_attendance_list" id="form_attendance_list">
	<fieldset style="border:2px solid #0099ff;">
		<legend>检索条件</legend>
		<table style="margin-bottom: 5px;margin-left: 10px">
		<tr>
			<td>学生：</td><td>
				<input type="text" readonly = "readonly" name="student_name" id="student_name" value="<?php echo $studentName;?>" style="width:80px;">　
				<input type="button" value="选择"  onclick="openSelectWin('student','student_id_select','student_name');">
				<input type="hidden" name="student_id_select" id="student_id_select" value="<?php echo $studentID;?>">
			</td>
			<td width="10px"></td>
			<td>课程：</td><td>
				<input type="text" readonly = "readonly" name="course_name" id="course_name" value="<?php echo $courseName;?>">　
				<input type="button" value="选择"  onclick="openSelectWin('course','course_id_select','course_name');">
				<input type="hidden" name="course_id_select" id="course_id_select" value="<?php echo $courseID;?>">
			</td>
			<td width="10px"></td>
			<td>批次：</td><td>
				<input type="text" name="course_batch_select" id="course_batch_select" value="<?php echo $courseBatch;?>" style="width:40px;">　
			</td>
			<td width="10px"></td>
			<td>节次：</td><td>
				<input type="text" name="lesson_num_select" id="lesson_num_select" value="<?php echo $lessonNum;?>" style="width:40px;">　
			</td>
			<td width="10px"></td>
			<td><input type="button" value="检索" class="button" onclick="commitSelect()"></td>
		</tr>
	</table>
	</fieldset>
	<br>
  <table width="100%" id="adm_comment_list" class="item_list">
  	<thead>
      <tr>
	<th width="50" colspan="1"><b>编号</b></th>
        <th width="80" colspan="1"><b>学生姓名</b></th>
		<th width="300"><b>课程名称</b></th>
		<th width="50"><b>批次</b></th>
		<th width="50"><b>节次</b></th>
		<th width="200"><b>上课时间</b></th>
		<th width="100"><b>签到状态</b></th>
        <th width="100"><b>操作</b></th>
      </tr>
    </thead>
    <tbody>
	<?php
	$i=0;
	if($attendances):
	foreach($attendances as $key=>$value):
		$i++;
	?>
     <tr>
		<td><?php echo $i; ?></td>
		<td><?php echo $value['student_name']; ?></td>
		<td><?php echo $value['course_name']; ?></td>
		<td><?php echo $value['course_batch']; ?></td>
		<td><?php echo $value['lesson_num']; ?></td>
		<td><?php echo $value['lesson_time']; ?></td>
		<td><?php echo $value['attendance_state_name']; ?></td>
 		<td>
			<input type="button" value="签到"  onclick="attendance('<?php echo $value['ID']; ?>','2');" <?php if($value['attendance_state']!=1) {echo("disabled"); } ?>>
			<input type="button" value="旷课" onclick="attendance('<?php echo $value['ID']; ?>','5');" <?php if($value['attendance_state']!=1) {echo("disabled"); } ?>>
		</td>
	<?php endforeach;else:?>
	  <tr><td class="tdcenter" colspan="6">还没有任何签到信息</td></tr>
	<?php endif;?>
	</tbody>
  </table>
    <div class="page"><?php echo $pageurl; ?> (共有<?php echo $attendanceNum; ?>个签到信息)</div>
	<input type="hidden" name="action" id="action" value="">
	<input type="hidden" name="attendanceID" id="attendanceID" value="">
	<input type="hidden" name="state" id="state" value="">
	<input type="hidden" name="pid" id="pid" value="<?php echo $page; ?>">
</form>
<script>
$(document).ready(function(){
	$("#select_all").toggle(function () {$(".ids").attr("checked", "checked");},function () {$(".ids").removeAttr("checked");});
	$("#adm_comment_list tbody tr:odd").addClass("tralt_b");
	$("#adm_comment_list tbody tr")
		.mouseover(function(){$(this).addClass("trover");$(this).find("span").show();})
		.mouseout(function(){$(this).removeClass("trover");$(this).find("span").hide();})
});
setTimeout(hideActived,2600);
function commitSelect(){
	$("#action").val("");
	$("#pid").val("1");
	$("#form_attendance_list").submit();
}
function attendance(attendanceID,state){
	$("#action").val("attendance");
	$("#attendanceID").val(attendanceID);
	$("#state").val(state);
	$("#form_attendance_list").submit();
}

$("#menu_cm").addClass('sidebarsubmenu1');
</script>